﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="childlist.aspx.cs" Inherits="UI.system.page.active.childlist" %>
<%@ Import Namespace="Common" %>
<style>
table td img{width:80px; height:80px;}
.down{width:100%; height:40px; text-align:right;}
</style>
<div style="margin: 15px;">
    <div class="down"><a class="layui-btn layui-btn-small layui-btn-normal" onclick="Download1()">批量下载链接</a><a class="layui-btn layui-btn-small layui-btn-normal" onclick="Download2()" style="margin-left:10px;">批量下载二维码</a></div>
    <table class="layui-table">
    <colgroup>
      <col>
      <col width="80">
    </colgroup>
    <thead>
      <tr>
        <th>链接</th>
        <th>二维码</th>
      </tr>
    </thead>
     <tbody id="layer-table">
        <tr><td colspan="2" class="center">数据加载中...</td></tr>
    </tbody>
    <script id="data-table" type="text/html">
      {{#  layui.each(d, function(index, item){ }}
      <tr>
        <td>http://www.mengshen666.cn/activesss.aspx?id={{item.IDs}}</td>
        <td><img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=http://www.mengshen666.cn/activesss.aspx?id={{item.IDs}}" /></td>
      </tr>
      {{#  }); }}
      </script>
  </table>
  <div id="layer-page" class="layer-page" style="bottom:0px; left:0px;"></div>
</div>
<script>
    function Init_Pager(pageindex) {
            var data = {};
            data.act = "Find_Ewm";
            data.activeid = '<%=Request["id"] %>';
            data.pageindex = pageindex;
            data.sign = GetSign(data.act);
            Loading();
            Ajax.Post("/tools/Admin.ashx", data, function (r) {
                var json = $.parseJSON(r);
                if (json.state) {
                    Pager(json.data.list, json.data.count);
                }
                else {
                    LayerBox.Error(json.msg);
                }
            });
        };
        Init_Pager(1);

        function Download1() {
            var data = {};
            data.act = "Download_Link";
            data.activeid = '<%=Request["id"] %>';
            data.sign = GetSign(data.act);
            var index = LayerBox.Loading();
            Ajax.Post("/tools/Admin.ashx", data, function (r) {
                LayerBox.Close.ByIndex(index);
                var json = $.parseJSON(r);
                if (json.state) {
                    DownLoads(json.data);
                }
                else {
                    LayerBox.Error(json.msg);
                }
            });
        };
        function Download2() {
            var data = {};
            data.act = "Download_Ewm";
            data.activeid = '<%=Request["id"] %>';
            data.sign = GetSign(data.act);
            var index=LayerBox.Loading();
            Ajax.Post("/tools/Admin.ashx", data, function (r) {
                LayerBox.Close.ByIndex(index);
                var json = $.parseJSON(r);
                if (json.state) {
                    DownLoads(json.data);
                }
                else {
                    LayerBox.Error(json.msg);
                }
            });
        };
</script>